package PTOP.ptopJmsTemplate;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.jms.core.JmsTemplate;

public class Consumer {
    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext(ConfigClass.class);
    JmsTemplate jmsTemplate = context.getBean(JmsTemplate.class);

        while (true){
        String s = (String) jmsTemplate.receiveAndConvert();
        if(s==null){
            System.out.println("no Message");
        }else{
            System.out.println(s);
        }
    }
}
}
